package com.binance.assetservice.api;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.binance.assetservice.vo.request.portfolio.AddPortfolioRequest;
import com.binance.assetservice.vo.request.portfolio.DeletePortfolioRequest;
import com.binance.assetservice.vo.request.portfolio.GetPortfoliosRequest;
import com.binance.assetservice.vo.request.portfolio.GetWidgetPortfoliosRequest;
import com.binance.assetservice.vo.request.portfolio.UpdatePortfolioSequenceRequest;
import com.binance.assetservice.vo.request.portfolio.UpdateWidgetPortfoliosRequest;
import com.binance.master.configs.FeignConfig;
import com.binance.master.constant.Constant;
import com.binance.master.models.APIRequest;
import com.binance.master.models.APIResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api
@FeignClient(name = Constant.ASSET_SERVICE, configuration = FeignConfig.class)
public interface IPortfolioApi {

    @ApiOperation(value = "添加一个自选股")
    @PostMapping(value = "/private/addPortfolio", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> addPortfolio(@RequestBody @Validated APIRequest<AddPortfolioRequest> request)
            throws Exception;

    @ApiOperation(value = "删除一个自选股")
    @PostMapping(value = "/private/deletePortfolio", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> deletePortfolio(@RequestBody @Validated APIRequest<DeletePortfolioRequest> request)
            throws Exception;

    @ApiOperation(value = "更新自选股顺序，按顺序传入list")
    @PostMapping(value = "/private/updatePortfolioSequence", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> updatePortfolioSequence(
            @RequestBody @Validated APIRequest<UpdatePortfolioSequenceRequest> request) throws Exception;

    @ApiOperation(value = "获取某个用户的自选股")
    @PostMapping(value = "/private/portfolios", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<List<String>> getPortfolios(@RequestBody @Validated APIRequest<GetPortfoliosRequest> request)
            throws Exception;

    @ApiOperation(value = "widgets获取自选")
    @PostMapping(value = "/private/widget/portfolios", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<List<String>> getWidgetPortfolios(
            @RequestBody @Validated APIRequest<GetWidgetPortfoliosRequest> request) throws Exception;

    @ApiOperation(value = "widgets更新自选")
    @PostMapping(value = "/private/widget/updatePortfolio", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> updateWidgetPortfolios(
            @RequestBody @Validated APIRequest<UpdateWidgetPortfoliosRequest> request) throws Exception;

}
